package com.hxkj.client.fallback;

import com.hxkj.client.service.PaymentClient;
import com.hxkj.domain.bo.PayParameter;
import com.hxkj.domain.bo.WithdrawParameter;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;
import org.springframework.stereotype.Component;

/**
 * 支付服务降级处理
 * <p>
 * Create by chenwei on 2018/8/9 10:38
 */
@Component
public class PaymentClientFallback implements PaymentClient {
    @Override
    public ResultDataStruct pay(PayParameter payParameter) {
        return null;
    }

    @Override
    public ResultMessageStruct getTradeStatus(PayParameter payParameter) {
        ResultMessageStruct resultMessageStruct = new ResultMessageStruct();
        resultMessageStruct.setCode(999);
        resultMessageStruct.setMessage("请求支付服务超时");
        return resultMessageStruct;
    }

    @Override
    public ResultMessageStruct withdraw(WithdrawParameter withdrawParameter) {
        ResultMessageStruct resultMessageStruct = new ResultMessageStruct();
        resultMessageStruct.setCode(999);
        resultMessageStruct.setMessage("请求支付服务超时");
        return resultMessageStruct;
    }

}
